//通过vue-router插件实现模板路由配置
import {createRouter, createWebHistory} from 'vue-router'
import {constantRoutes} from "./constantRoutes.ts";
//创建路由器
let router = createRouter({
//路由模式
    history: createWebHistory(),
    routes: constantRoutes,
    //设置滚动行为，保证切换时 滚动条位于最顶端
    scrollBehavior() {
        return {
            left: 0,
            top: 0
        }
    }
});

export default router;